package com.wxb.hello.auth.service;


import com.wxb.hello.auth.exception.CustUsernameNotFoundException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

/**
 * @author Feng Yu
 * @version V1.0
 * @date 2017-06-12
 */
@Service("userDetailsService")
public class CustUserDetailsService implements UserDetailsService {

    private final static Logger logger = LoggerFactory.getLogger(CustUserDetailsService.class);


    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {

        //获取登录用户信息
        CustUserDetails user = new CustUserDetails("wxb", "$2a$04$vZJc48xG7SmG8okWFD80uu6JtVHwdT0zQ5f8lmO.hHPuy646nTNC2", "ROLE_TM_USER", "");

        return user;
    }
}
